/**
 * @file wa_roller.h
 *
 */

#ifndef _WA_ROLLER_H
#define _WA_ROLLER_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/
#include "wa_conf.h"
#if USE_WA_ROLLER != 0
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_area.h"
#include "wa_obj.h"
#include "wa_mask_draw.h"
#include "wa_wm.h"
#include "wa_font.h"
#include "wa_image.h"	
#include "wa_anim.h"
#include "wa_malloc.h"
/*********************
*      DEFINES
*********************/


/**********************
*      TYPEDEFS
**********************/
typedef enum
{
	WA_ROLLER_TYPE_HOR,
	WA_ROLLER_TYPE_VER,
}wa_roller_type;

typedef struct
{
#if USE_WA_ANIM != 0
	wa_anim* anim;
#endif
	wa_result anim_enable;
	uint32_t switch_time_length;

	wa_roller_type type;
	wa_font* font;
	char** option_text;
	uint32_t option_cnt;

	uint32_t select;
	uint8_t space;

	wa_gui_color fore_color;
	wa_gui_color back_color;

	int32_t pos;

	wa_result pid;
	wa_result input;
}wa_roller_ext;

/**********************
* GLOBAL PROTOTYPES
**********************/
void wa_roller_module_init(void);
wa_obj* wa_roller_create(wa_obj* par);
void wa_roller_add_option(wa_obj* roller, char* text);
void wa_roller_clear_option(wa_obj* roller);
void wa_roller_set_select(wa_obj* roller, uint32_t select);
void wa_roller_set_type(wa_obj* roller, wa_roller_type type);
void wa_roller_set_font(wa_obj* roller, wa_font* font);
void wa_roller_set_space(wa_obj* roller, uint32_t space);
void wa_roller_set_anim_enable(wa_obj* roller, wa_result anim_enable);
void wa_roller_set_switch_time_length(wa_obj* roller, uint32_t length);
void wa_roller_set_fore_color(wa_obj* roller, wa_gui_color fore_color);
void wa_roller_set_back_color(wa_obj* roller, wa_gui_color back_color);
uint32_t wa_roller_get_select(wa_obj* roller);
wa_roller_type wa_roller_get_type(wa_obj* roller);
wa_font* wa_roller_get_font(wa_obj* roller);
uint32_t wa_roller_get_space(wa_obj* roller);
wa_result wa_roller_get_anim_enable(wa_obj* roller);
uint32_t wa_roller_get_switch_time_length(wa_obj* roller);
wa_gui_color wa_roller_get_fore_color(wa_obj* roller);
wa_gui_color wa_roller_get_back_color(wa_obj* roller);
void wa_roller_init_select_pos(wa_obj* roller);
/**********************
*      MACROS
**********************/

#endif

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif

